Skip to content

Conversation

@JelteMX
Copy link
Contributor

@JelteMX JelteMX commented Mar 3, 2021

For certain scripts we need to include the widget itself as a context. In versions before 3.9.3 this worked, as this refered to the widget itself. In that version the context was changed to an object with only jQuery as a context.

This fix will add the widget itself as a context as well, so we can do:

var widget = this.widget;
widget.addOnDestroy(function () {
	// This gets executed when the HTMLSnippet widget is destroyed
});

@JelteMX JelteMX requested a review from diego-antonelli March 3, 2021 14:50
@JelteMX
Copy link
Contributor Author

JelteMX commented Mar 3, 2021

@diego-antonelli are you ok with me merging this change and releasing a new version?

@diego-antonelli
Copy link
Contributor

@JelteMX this widget is now responsibility of Web Content and PMs.. We should ask them first.

@diego-antonelli
Copy link
Contributor

@cjfhodges can you check it?

@cjfhodges
Copy link

@JelteMX was this a reported bug?

Copy link

@cjfhodges cjfhodges left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved.

@JelteMX JelteMX removed the request for review from diego-antonelli March 4, 2021 11:56
@JelteMX
Copy link
Contributor Author

JelteMX commented Mar 4, 2021

@cjfhodges this was a bug we encountered in one of our internal projects (OKR) after they updated to a new version of the widget. My changes will make it work again (and a test-version with these changes runs successfully in the project).

I will merge and release a new version

@diego-antonelli diego-antonelli self-requested a review March 4, 2021 12:03
@diego-antonelli diego-antonelli merged commit 27a4af5 into master Mar 4, 2021
@diego-antonelli diego-antonelli deleted the feature/widget_context branch March 4, 2021 12:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants